package com.xr.sy.modules.business.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xr.common.service.impl.CrudServiceImpl;
import com.xr.sy.modules.business.dao.SysTypeDao;
import com.xr.sy.modules.business.dto.SysTypeDTO;
import com.xr.sy.modules.business.entity.SysTypeEntity;
import com.xr.sy.modules.business.service.SysTypeService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 
  @since 1.0.0 2019-07-15
 */
@Service
public class SysTypeServiceImpl extends CrudServiceImpl<SysTypeDao, SysTypeEntity, SysTypeDTO> implements SysTypeService {

    @Override
    public QueryWrapper<SysTypeEntity> getWrapper(Map<String, Object> params){
        QueryWrapper<SysTypeEntity> wrapper = new QueryWrapper<>();
        String type = (String)params.get("type");
        String code = (String)params.get("code");
        wrapper.like(StringUtils.isNotBlank(type), "type", type);
        wrapper.like(StringUtils.isNotBlank(code), "code", code);
        wrapper.orderByAsc("no");
        return wrapper;
    }

}